package com.softhis.rekrutacja.client.view.widgets.interfaces;

import com.extjs.gxt.ui.client.event.KeyListener;
import com.extjs.gxt.ui.client.widget.form.Validator;

/**
 * Wrap interface for text field.
 * 
 * @author Sasak
 */
public interface ITextField {

	/**
	 * Sets text in the text field
	 * 
	 * @param text
	 *            text to set
	 */
	public void setText(String text);

	/**
	 * Returns the text from the text field
	 * 
	 * @return text entered into the text field
	 */
	public String getText();

	/**
	 * Sets validator for text field
	 * 
	 * @param validator
	 *            field validator
	 */
	public void setValidator(Validator validator);

	/**
	 * Adds key listener to the field
	 * 
	 * @param listener
	 *            listener to add
	 */
	public void addKeyListener(KeyListener listener);

	/**
	 * Sets fields label
	 * 
	 * @param label
	 *            label to set
	 */
	public void setFieldLabel(String label);
}